home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
taropyon
/
guilib3
/
inc
/
dialog.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-30
|
9KB
|
208 lines
/* :*****************************************************************
: "dialog.h" : system“Pride”ダイアログ・ライブラリ
:*****************************************************************
*/
#ifndef _DIALOG_H
#define _DIALOG_H
#ifndef _GUIDEFS_H
# include "guidefs.h"
#endif
#ifndef _DISP_H
# include "disp.h"
#endif
#ifndef _EVENT_H
# include "event.h"
#endif
typedef struct /* ダイアログ座標構造体 */
{ SHORT x0, y0, xs, ys;
} DLGBOX;
typedef struct /* ダイアログ構造体 */
{
DLGBOX fr; /* 座標 */
COLOR baseCol; /* ベースカラー */
GBLK *gbuf; /* VRAM退避用バッファ */
char page; /* 書き込みページ保存用 */
void (*func)(); /* 描画関数 */
void *ptr; /* ユーザーパラメータポインタ */
} DLG_T;
#define DLG DLG_T
#define DLGPOS_MOS_SET_HOME (0x10010) /* マウス位置(左上) */
#define DLGPOS_MOS_SET_CENTER (0x10020) /* マウス位置中央 */
#define DLGPOS_CENTER_OF_SCN (0x10030) /* 画面中央 */
#define DLGPOS_CENTER_OF_POS(p) (0x20000+((p)&0xFFFF)) /* 指定の座標を中心に */
#ifdef _DIALOG_MAIN
GBLK *_dlg_push_vram( FRAME *fr );
void _dlg_pop_vram( GBLK *buf);
void _dlg_free_vram( GBLK *buf);
void *((*_DlgPushVram)()) = (void *((*)()))_dlg_push_vram;
void (*_DlgPopVram)() = _dlg_pop_vram;
void (*_DlgFreeVram)() = _dlg_free_vram;
#else
extern void *((*_DlgPushVram)());
extern void (*_DlgPopVram)();
extern void (*_DlgFreeVram)();
#endif
#define DLG_FREE_VRAM(buf) (_DlgFreeVram)((buf))
#define DLG_PUSH_VRAM(fr) (_DlgPushVram)((fr))
#define DLG_POP_VRAM(buf) (_DlgPopVram)((buf))
extern int DLG_setArea( int x1, int y1, int x2, int y2 );
extern DLG_T *DLG_open( int x0, int y0, int xs, int ys, COLOR baseCol, void (*func)(), void *ptr );
extern int DLG_dsp( DLG_T *dlg );
extern void DLG_move( DLG_T *dlg, int x0, int y0);
extern void DLG_close( DLG_T *dlg );
/* "dlgsub1.c" ------------------------------------------------*/
extern void DLG_topBar( DLGBOX *fr, COLOR stlCol, COLOR barCol );
extern void DLG_title( DLGBOX *fr, COLOR stlCol, COLOR barCol, CONST char *msg );
/* "dlgsub2.c" ------------------------------------------------*/
extern void DLG_shadow( DLGBOX *fr );
extern void DLG_toDlgbox( FRAME *fr, DLGBOX *db );
extern void DLG_corect( DLGBOX *fr );
/* "dlgmove.c" ------------------------------------------------*/
#define DLG_ANI_CLK (48*CLOCKS_PER_SEC/100)
#define DLG_ANI_CLK2 (26*CLOCKS_PER_SEC/100)
#define DlgMoveAnime(newFr,oldFr,clk) \
BoxMoveAnime( (newFr), (oldFr), DspCtrl.writePage, (clk) );
extern int DlgMove( DLGBOX *fr );
/* "dlgmvfnc.c" ------------------------------------------------*/
extern int DLG_defMoveFunc( int evtNo, EVTSBJ_T *sbj );
/* "dlg010.c" ------------------------------------------------*/
/* "dlg011.c" ------------------------------------------------*/
extern DLG_T *DLG_graphMeterOpen( int x0, int y0, int strCol, int bacCol, int boxCol, CONST char *title, ... );
extern int DLG_graphMeterStart( DLG_T *dlg, int start, int goal, int div );
extern void DLG_graphMeterDsp( DLG_T *dlg, int val );
extern void DLG_graphMeterPuts( DLG_T *dlg, COLOR strCol, CONST char *msg, ... );
extern void DLG_graphMeterClose( DLG_T *dlg );
extern void DLG_graphMeterCloseMsg( DLG_T *dlg, int waitSec, COLOR strCol, CONST char *msg, ... );
/* "dlg012.c" ------------------------------------------------*/
extern DLG_T *DLG_getsOpen( int x0, int y0, int minXs, CONST char *msg, ... );
extern void DLG_getsClose( DLG_T *dlg );
extern int DLG_getsSetTitle( DLG_T *dlg, CONST char *title, ... );
extern int DLG_getsStart( DLG_T *dlg, size_t bufSize, char *buf );
/* "dlg014.c" ------------------------------------------------*/
#define DLGMSG_POS_CONTINUE (-1)
#define DLGMSG_POS_CENTERING (-2)
extern DLG_T *DLG_msgOpen( int x0, int y0, int cnsXs, int cnsYs, int strCol, int bacCol, int boxCol, CONST char *title, ... );
extern int DLG_msgSetConfig( DLG_T *dlg, int tab, int fntX, int fntY );
extern int DLG_msgSetCenteringMode( DLG_T *dlg, int md );
extern int DLG_msgSetPosition( DLG_T *dlg, int cx0, int cy0 );
extern int DLG_msgSetColor( DLG_T *dlg, int col, int bac );
extern void DLG_msgClear( DLG_T *dlg, int bacCol );
extern int DLG_msgPutc( DLG_T *dlg, int ch );
extern int DLG_msgPuts( DLG_T *dlg, CONST char *s );
extern int DLG_msgPrintf( DLG_T *dlg, CONST char *form, ... );
extern int DLG_msgWrtstr( DLG_T *dlg, CONST char *msg, int cx0, int cy0, int col, int bac );
extern void DLG_msgClose( DLG_T *dlg );
/* "dlg015.c" ------------------------------------------------*/
extern int DLG_tmpMsgBox (
int x0, int y0, int strCol, int bacCol, int boxCol,
CONST char *form, ... );
/* "dlg016.c" ------------------------------------------------*/
extern int DLG_tmpMsgTime (
int x0, int y0, int strCol, int bacCol, int boxCol, int waitSec,
CONST char *form, ... );
/* "dlg017.c" ------------------------------------------------*/
typedef struct
{
UCHAR typ; /* タイプ */
UCHAR eatt; /* イベント属性 */
UCHAR matt; /* メッセージ属性 */
UCHAR batt; /* ボタン属性 */
int flen; /* 表示文字数 */
char *msg; /* 表示メッセージ */
int attr; /* イベント登録属性 */
int evtNo; /* イベントNo */
int (*func)(int,EVTSBJ_T *); /* イベント関数 */
void *ptr; /* 汎用ポインタ */
char key; /* ショートカットキー */
} DLGLSTSEL_T;
typedef struct
{ DLGLSTSEL_T *sel; /* 配列 */
} DLGLSTOBJ_T;
#define DLGLST_ATT_OBJKEY (1) /* ショートカットキー禁止 */
#define DLGLST_SELTYP_MSG (0)
#define DLGLST_SELTYP_BTN (1)
#define DLGLST_SELMATT_RIGHTCUT (0) /* 右を切る */
#define DLGLST_SELMATT_LEFTCUT (1) /* 左を切る */
#define DLGLST_SELEATT_IGN (1)
#define DLGLST_SELBATT_ON (1)
#define DLGLST_SELBATT_LEFT (2)
extern DLGLSTOBJ_T *DLG_lstAllocObj( int objN, int selN );
extern int DLG_lstFreeObj( DLGLSTOBJ_T *obj, int objN, int selN);
extern int DLG_lstSetSel( DLGLSTOBJ_T *obj, int objPos, int selPos,
int typ, int eatt, int matt, int batt, int flen,
int attr, int evtNo, int (*func)(int,EVTSBJ_T *), void *ptr,
int key, CONST char *msg, ... );
extern DLG_T *DLG_lstOpen( int x0, int y0, int xn, int yn, int objN, int selN, DLGLSTOBJ_T *obj, int mnuNum );
extern int DLG_lstChangeObj( DLG_T *dlg, int objN, int selN, DLGLSTOBJ_T *dlg );
extern int DLG_lstSetSelNo( DLG_T *dlg, int selNo );
extern int DLG_lstSetTitle( DLG_T *dlg, CONST char *title, ... );
extern int DLG_lstSetGuideMsg( DLG_T *dlg, CONST char *msg, ... );
extern int DLG_lstSetMnuBtn( DLG_T *dlg, int attr, int (*func)(int,EVTSBJ_T *), void *ptr, CONST char *msg, ... );
extern int DLG_lstStart( DLG_T *dlg);
extern int DLG_lstClose( DLG_T *dlg);
/* "dlg018.c" ------------------------------------------------*/
typedef struct _dlgtxtlin_t
{
struct _dlgtxtlin_t *next;
struct _dlgtxtlin_t *prev;
size_t len;
char p[1];
} DLGTXTLIN_T;
extern DLG_T *DLG_txtOpen( int x0, int y0, int xn, int yn, DLGTXTLIN_T *topLin, int mnuNum );
extern int DLG_txtChangeLin( DLG_T *dlg, DLGTXTLIN_T *topLin );
extern int DLG_txtSetTitle( DLG_T *dlg, CONST char *title, ... );
extern int DLG_txtSetGuideMsg( DLG_T *dlg, CONST char *msg, ... );
extern int DLG_txtSetMnuBtn( DLG_T *dlg, int attr, int (*func)(int,EVTSBJ_T *), void *ptr, CONST char *msg, ... );
extern int DLG_txtStart( DLG_T *dlg );
extern int DLG_txtClose( DLG_T *dlg );
extern DLGTXTLIN_T *DLG_txtSetLinBuf( DLGTXTLIN_T *crtLin, int tab, int xs, CONST char *msg, ... );
extern int DLG_txtFreeLinBuf( DLGTXTLIN_T *topLin );
/* "dlg019.c" ------------------------------------------------*/
extern DLG_T *DLG_019open( int x0, int y0, int lxs, int lys, CONST char *title, ... );
extern int DLG_019close( DLG_T *dlg );
extern int DLG_019setObj( DLG_T *dlg, CONST char *form, ... );
extern int DLG_019freeObj( DLG_T *dlg );
extern int DLG_019start( DLG_T *dlg, char *buf, size_t bufSiz );
/* "dlg020.c" ------------------------------------------------*/
typedef struct
{
CONST char *msg;
COLOR col;
COLOR _dmy;
} DLGCOLTBL_T;
extern DLG_T *DLG_colTblOpen( int x0, int y0, int colNum, DLGCOLTBL_T *colTbl );
extern int DLG_colTblSetTitle( DLG_T *dlg, CONST char *form, ... );
extern int DLG_colTblStart( DLG_T *dlg );
extern int DLG_colTblClose( DLG_T *dlg );
#endif